package cn.cpf.spring.model;

import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class Student {

    private String name;

    private List<Book> books;

    public Student() {
        System.out.println("student construct");
    }

    public Student(String name) {
        System.out.println("student construct -> String name");
        this.name = name;
    }

    public Student(String name, List<Book> books) {
        this.name = name;
        this.books = books;
        System.out.println("student construct -> String name, List<Book> books");
    }

    public void read(){
        System.out.println(name + " has books like " + books);
    }

    public String aop(String conpoent, String food){
        System.out.println(name + " 在 " + conpoent + " 上一边吃" + food + ", 一边 read" + books);
        return conpoent + " " + food + "   6";
    }

    public String getName() {
        System.out.println("student getter -> String name" + name);
        return name;
    }

    public void setName(String name) {
        this.name = name;
        System.out.println("student setter -> String name" + name);
    }

    public List<Book> getBooks() {
        System.out.println("student getter -> String name" + books);
        return books;
    }

    public void setBooks(List<Book> books) {
        this.books = books;
        System.out.println("student setter -> String books" + books);
    }

    public void init(){
        System.out.println("student -- init");
    }

    public void destory(){
        System.out.println("student -- destory");
    }

}
